import service from '../request'

/**
 * 添加分类
 * @param {*} data 
 * @returns 
 */
export function addCategoryApi(data) {
  return service({
    url: '/category/add',
    method: 'post',
    data
  })
}

/**
 * 更新分类信息
 * @param {*} data 
 * @returns 
 */
export function updateCategoryInfoApi(data) {
  return service({
    url: '/category/update',
    method: 'post',
    data
  })
}
/**
 * 删除分类
 * @param {*} data 
 * @returns 
 */
export function deleteCategoryApi(data) {
  return service({
    url: '/category/delete',
    method: 'post',
    data
  })
}
/**
 * 获取所有分类
 * @param {*} data 
 * @returns 
 */
export function getAllCategoryApi(data) {
  return service({
    url: '/category/allList',
    method: 'post',
    data,
    noNeedLogin: true
  })
}